package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.MesOrderPalletRecordMapper;
import com.ruoyi.order.domain.MesOrderPalletRecord;
import com.ruoyi.order.service.IMesOrderPalletRecordService;

/**
 * 托盘占用记录Service业务层处理
 * 
 * @author guoxl
 * @date 2025-04-15
 */
@Service
public class MesOrderPalletRecordServiceImpl implements IMesOrderPalletRecordService 
{
    @Autowired
    private MesOrderPalletRecordMapper mesOrderPalletRecordMapper;

    /**
     * 查询托盘占用记录
     * 
     * @param id 托盘占用记录主键
     * @return 托盘占用记录
     */
    @Override
    public MesOrderPalletRecord selectMesOrderPalletRecordById(Long id)
    {
        return mesOrderPalletRecordMapper.selectMesOrderPalletRecordById(id);
    }

    /**
     * 查询托盘占用记录列表
     * 
     * @param mesOrderPalletRecord 托盘占用记录
     * @return 托盘占用记录
     */
    @Override
    public List<MesOrderPalletRecord> selectMesOrderPalletRecordList(MesOrderPalletRecord mesOrderPalletRecord)
    {
        return mesOrderPalletRecordMapper.selectMesOrderPalletRecordList(mesOrderPalletRecord);
    }

    /**
     * 新增托盘占用记录
     * 
     * @param mesOrderPalletRecord 托盘占用记录
     * @return 结果
     */
    @Override
    public int insertMesOrderPalletRecord(MesOrderPalletRecord mesOrderPalletRecord)
    {
        mesOrderPalletRecord.setCreateTime(DateUtils.getNowDate());
        return mesOrderPalletRecordMapper.insertMesOrderPalletRecord(mesOrderPalletRecord);
    }

    /**
     * 修改托盘占用记录
     * 
     * @param mesOrderPalletRecord 托盘占用记录
     * @return 结果
     */
    @Override
    public int updateMesOrderPalletRecord(MesOrderPalletRecord mesOrderPalletRecord)
    {
        mesOrderPalletRecord.setUpdateTime(DateUtils.getNowDate());
        return mesOrderPalletRecordMapper.updateMesOrderPalletRecord(mesOrderPalletRecord);
    }

    /**
     * 批量删除托盘占用记录
     * 
     * @param ids 需要删除的托盘占用记录主键
     * @return 结果
     */
    @Override
    public int deleteMesOrderPalletRecordByIds(Long[] ids)
    {
        return mesOrderPalletRecordMapper.deleteMesOrderPalletRecordByIds(ids);
    }

    /**
     * 删除托盘占用记录信息
     * 
     * @param id 托盘占用记录主键
     * @return 结果
     */
    @Override
    public int deleteMesOrderPalletRecordById(Long id)
    {
        return mesOrderPalletRecordMapper.deleteMesOrderPalletRecordById(id);
    }
}
